import java.io.File;
import java.io.IOException;
import java.util.Scanner;

public class Dict {
	/*
	 * data about the dictionary
	 */
	public String dict_name;
	
	public int cnt_words;

	public String word[];

	public String pron[];

	public String def_cn[];

	public String def_en[];
	
	
	/*
	 * init dictionary
	 */
	public void init_dict(String _dict_name) throws IOException {
		dict_name = _dict_name;
		
		Scanner cin = null;
		cin = new Scanner(new File(dict_name + ".txt"), "UTF-8");
		cnt_words = cin.nextInt();
		word = new String[cnt_words];
		pron = new String[cnt_words];
		def_cn = new String[cnt_words];
		// def_en = new String[cnt_words];

		for (int i = 0; i < cnt_words; ++i) {
			word[i] = cin.next();
			pron[i] = cin.next();
			while (pron[i].charAt(pron[i].length() - 1) != ']' && pron[i].charAt(pron[i].length() - 1) != '\"') {
				pron[i] = pron[i] + " " + cin.next();
			}
			def_cn[i] = cin.nextLine();		
			def_cn[i] = def_cn[i].replaceAll("/", "<br/>");
			
			pron[i] = pron[i].replace('1', 'æ');
			pron[i] = pron[i].replace('2', 'ɑ');
			pron[i] = pron[i].replace('3', 'ɔ');
			pron[i] = pron[i].replace('4', 'ə');
			pron[i] = pron[i].replace('5', 'ʃ');
			pron[i] = pron[i].replace('6', 'ŋ');
			pron[i] = pron[i].replace('7', 'θ');
			pron[i] = pron[i].replace('8', 'ʌ');
			pron[i] = pron[i].replace('9', 'ʒ');
			pron[i] = pron[i].replace('A', 'ɛ');
			pron[i] = pron[i].replace('`', ',');
		}
	}

}
